<?php
namespace App\Http\Controllers\Admin\User;

use App\Http\Controllers\Admin\BaseController;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Http\Request;

class AuthenticationController extends BaseController
{
     protected  $api_url = [
        'index' => ['get', 'authentication'],
        'show' => ['get', 'authentication/%d'],
        'store' => ['post', 'authentication'],
        'put' => ['put', 'authentication/%d'],
        'delete' => ['delete', 'authentication/%d']
    ];

    protected $request;

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    public function indexAction(){
        $search_params = $this->request->all(['keyword', 'created_at']);
       
        $page = $this->request->get('page', 1);        
        $params = [
            'search' => search_params($search_params),
            'searchJoin' => 'and',
            'page' => $page
        ];

        $ret = http_admin($this->api_url['index'])->send($params);
        $data = $ret['data'];      
        $data['search_params'] = $search_params;//回填搜索框值

        return view('Admin.user.authentication', paginate($this->request, $data));
    }

    public function showAction($id){

    }


    
    public function updateAction($id)
    {       
        
    }

    //update公共方法
    private function update($id, $data)
    {  
       
    }




}
